package com.tensquare.recruit.dao;

import com.tensquare.recruit.pojo.Enterprise;
import com.tensquare.recruit.pojo.Recruit;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * & ProjectName：  tensquare-parent
 * & PackageName:   com.tensquare.recruit.dao
 * & Creation_Date： 2020/3/31 00:05
 * & Author：しの
 * ----------------------------------
 * & Description:
 */
public interface RecruitDao extends JpaRepository<Recruit, String>, JpaSpecificationExecutor<Recruit> {
    //1 查询状态为2并以创建日期降序排序，查询前4条记录
    List<Recruit> findTop4ByStateOrderByCreatetimeDesc(String state);
    //2 查询状态不为0并以创建日期降序排序，查询前12条记录
    List<Recruit> findTop12ByStateNotOrderByCreatetimeDesc(String state);
}
